﻿package org.openChart.util 
{
	
	/**
	 * ...
	 * @author Chongyuan
	 */
	public class Rectangle 
	{
		private var top_:Number;
		private var bottom_:Number;
		private var left_:Number;
		private var right_:Number;
		
		public function Rectangle(top_:Number, bottom_:Number, left_:Number, right_:Number) 
		{
			if (top < 0 || bottom < 0 || left < 0 || right < 0 )
			{
				throw new Error("The value is less than zero!");
			}
			if (top > bottom || left > right)
			{
				throw new Error("The area is not valid!");
			}
			
			this.top_ = top_;
			this.bottom_ = bottom_;
			this.left_ = left_;
			this.right_ = right_;
		}
		
		public function get top():Number
		{
			return top_;
		}
		
		public function set top(top_:Number):void
		{
			this.top_ = top_;
		}
		
		public function get bottom():Number
		{
			return bottom_;
		}
		
		public function set bottom(bottom_:Number):void
		{
			this.bottom_ = bottom_;
		}
		
		public function get left():Number
		{
			return left_;
		}
		
		public function set left(left_:Number):void
		{
			this.left_ = left_;
		}
		
		public function get right():Number
		{
			return right_;
		}
		
		public function set right(right_:Number):void
		{
			this.right_ = right_;
		}
	}
	
}